import axios from 'axios';

export default {
    install: function(Vue, options) {

        let service = {
            // 查询交易审计记录
            QueryTradeAudits: (condition, pageIndex, pageSize) => {
                if (condition.PayNo) {
                    condition.PayNos = [ condition.PayNo ];
                }
                return axios.post(`/admin/trade/audit/query?pageIndex=${pageIndex}&pageSize=${pageSize}`, condition);
            },

            // 查询交易审计记录数量
            QueryTradeAuditsCount: (condition) => {
                if (condition.PayNo) {
                    condition.PayNos = [ condition.PayNo ];
                }
                return axios.post('/admin/trade/audit/query/count', condition);
            },
        }

        Vue.prototype.$TradeAuditService = service;
    }
}